function DeepClone (source) {
  const targetObj = source instanceof Array ? [] : {}; // 判断复制的目标是数组还是对象
  for (let keys in source) { // 遍历目标
    if (source.hasOwnProperty(keys)) {
      if (source[keys] && typeof source[keys] === 'object') { // 如果值是对象，就递归一下
        targetObj[keys] = source[keys].constructor === Array ? [] : {};
        targetObj[keys] = DeepClone(source[keys]);
      } else { // 如果不是，就直接赋值
        targetObj[keys] = source[keys];
      }
    }
  }
  return targetObj;
}

function Map (obj, itemFun) {
  let keys = Object.keys(obj)
  for (let index = 0; index < keys.length; index++) {
    itemFun(obj[keys[index]], index, keys[index])
  }

}

export default {
  DeepClone,
  Map,
};